<template>
    <el-table :data="tableData" style="width: 100%">
        <!-- 图片列 -->
        <el-table-column prop="coverImage" label="图片" width="150">
            <template #default="{ row }">
                <img :src="row.coverImage" alt="商品图片" style="width: 100px; height: auto;" />
            </template>
        </el-table-column>
        <!-- 商品名称列 -->
        <el-table-column prop="name" label="商品" width="120" />
        <!-- id 列 -->
        <el-table-column prop="id" label="id" width="120" />


    </el-table>
</template>



<script setup>



import axios from "axios";
import { ref } from "vue"


const handleClick = () => {
    console.log('click')
}

const tableData = ref([])



let per = 200
let page = 1

let token = localStorage.getItem("token")
axios.get("http://localhost:1337/api/v1/admin/productcategory", {
    params: {
        per,
        page,
        name
    }, headers: {
        token
    }
}).then(r => {
    tableData.value = r.data.data
    console.log(r.data.data);
})
</script>

<style></style>
